package com.qinglei.recoup.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.lettuce.core.dynamic.annotation.CommandNaming;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 房间表
 *
 * @author syp
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_bed")
@ApiModel(value = "Bed对象", description = "床位表")
public class Bed implements Serializable {

    private static final long serialVersionUID = 1L;
    //状态 1-正常 2-事件报警
    public static final int STATUS_NORMAL = 1;
    public static final int STATUS_ALARM = 2;
//    public static final int STATUS_DEVICE_OFFLINE = 3;

    /*监测时段正常子状态 1-离床 2-清醒 3-浅睡 4-深睡 5-无人 6-有人*/
    public static final int SUB_STATUS_OUT_BED = 1;
    public static final int SUB_STATUS_CLEAR = 2;
    public static final int SUB_STATUS_LIGHT_SLEEP = 3;
    public static final int SUB_STATUS_DEEP_SLEEP = 4;
    public static final int SUB_STATUS_EXIST_NONE = 5;
    public static final int SUB_STATUS_EXIST_SOMEONE = 6;

    /*异常事件子状态
    1-离床过久
    2-跌倒
    */
    public static final int SUB_STATUS_OUT_BED_TOO_LONG = 1;
    public static final int SUB_STATUS_FALL_DOWN = 2;




    /*监测仪是否开启 1-开启 0-关闭',*/
    public static final int RADAR_ON = 1;
    public static final int RADAR_OFF = 0;

    //雷达是否在线 1-在线 0-离线
    public static final int RADAR_OFFLINE = 0;
    public static final int RADAR_ONLINE = 1;

    @ApiModelProperty(value = "床位ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "床位名称")
    private String name;

    @ApiModelProperty(value = "楼ID")
    private Integer buildingId;

    @ApiModelProperty(value = "楼层ID")
    private Integer floorId;

    @ApiModelProperty(value = "房间ID")
    private Integer roomId;

    @ApiModelProperty(value = "监测仪是否开启 1-开启 0-关闭")
    private Integer isRadarOn;

    @ApiModelProperty(value = "监测仪是否在线 1-在线 0-离线")
    private Integer isRadarOnline;

    @ApiModelProperty(value = "状态 1-正常 2-事件报警")
    private Integer status;

    @ApiModelProperty(value = "子状态 监测时段正常子状态 1-离床 2-清醒 3-浅睡 4-深睡 5-有人 6-无人 异常事件子状态 1-离床过久 2-跌倒 3-呼吸过速 " +
            "4-呼吸暂停过久 5-心跳过缓 6-心跳过速")
    private Integer subStatus;

    @ApiModelProperty(value = "事件ID")
    private Long eventId;

    @ApiModelProperty(value = "离床发生时间")
    //@TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime happenTime;

    @ApiModelProperty(value = "[废弃]监测时段ID 0-不在监测时段 其他对应监测时段ID")
    @Deprecated
    private Integer monitorTimeId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime modifyTime;

    @ApiModelProperty(value = "租户ID")
    private Integer tenantId;

    @ApiModelProperty(value = "监测仪关闭备注")
    private String remarks;

    @ApiModelProperty(value = "0-未删除 1-已删除")
    @TableLogic
    private Integer isDeleted;

    @ApiModelProperty(value = "离床时间阈值 格式hh:mm:ss")
    private String outBedTimeout;

    @ApiModelProperty(value = "用户情况备注")
    private String userRemarks;

    @ApiModelProperty(value = "事件ID")
    private Long healthEventId;

    @ApiModelProperty(value = "雷达版本号")
    private String radarVersion;

    @ApiModelProperty(value = "雷达网络信号是否好(0-好,1-不好）")
    private Integer isRadarNetwork;


}
